package ysq.xyg.ticket.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 票卷模块-订单信息实体类
 *
 * @author shengQiang yu
 * @date 2019-10-30 10:23:26
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_ticket_order")
public class TicketOrder implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 商品名称
     */ 
	@Column(name = "name")
	private String name;
	
	/**
     * 缩略图
     */ 
	@Column(name = "thum_image")
	private String thumImage;
	
	/**
     * 票卷商品id
     */ 
	@Column(name = "ticket_product_id")
	private String ticketProductId;
	
	/**
     * 会员id
     */ 
	@Column(name = "member_id")
	private String memberId;
	
	/**
     * 状态:1、待付款，2、待使用，3、待评价，4、售后中，5、已完成
     */ 
	@Column(name = "status")
	private String status;
	
	/**
     * 购买数量
     */ 
	@Column(name = "buy_num")
	private String buyNum;
	
	/**
     * 单价
     */ 
	@Column(name = "unit_price")
	private String unitPrice;
	
	/**
     * 优惠金额
     */ 
	@Column(name = "coupon_money")
	private String couponMoney;
	
	/**
     * 优惠卷id
     */ 
	@Column(name = "coupon_id")
	private String couponId;
	
	/**
     * 支付价格
     */ 
	@Column(name = "result_money")
	private String resultMoney;
	
	/**
     * 支付类型，1、微信支付
     */ 
	@Column(name = "payment_type")
	private String paymentType;
	
	/**
     * 买家留言
     */ 
	@Column(name = "buyer_message")
	private String buyerMessage;
	
	/**
     * 付款时间
     */ 
	@Column(name = "payment_time")
	private Date paymentTime;
	
	/**
     * 微信支付订单号
     */ 
	@Column(name = "wechat_order_no")
	private String wechatOrderNo;
	
	/**
     * 姓名
     */ 
	@Column(name = "link_name")
	private String linkName;
	
	/**
     * 手机号
     */ 
	@Column(name = "link_phone")
	private String linkPhone;
	
	/**
     * 扫描管理人id
     */ 
	@Column(name = "use_member_id")
	private String useMemberId;
	
	/**
     * 使用时间
     */ 
	@Column(name = "use_time")
	private Date useTime;
	
	/**
     * 退货原因
     */ 
	@Column(name = "return_message")
	private String returnMessage;
	
	/**
     * 售后状态：1、待处理，2、已退款，3、退款失败，4、不予退款
     */ 
	@Column(name = "service_state")
	private String serviceState;
	
	/**
     * 售后描述
     */ 
	@Column(name = "service_message")
	private String serviceMessage;
	
	/**
     * 删除标识：1、正常，2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	

	public TicketOrder(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}